﻿using System;

namespace HEFramework
{
    /// <summary>
    ///
    /// 资源读取件接口
    /// 
    /// ----------------------------------------
    /// 作者 hep
    /// 创建时间：2023-12-19 20:33:25
    /// ----------------------------------------
    /// </summary>
    public interface IAssetLoad
    {
        /// <summary>
        /// 读取资源（同步）
        /// </summary>
        /// <param name="_assetBundleName">AB包名称</param>
        /// <param name="_assetName">读取资源名称</param>
        /// <param name="_extension">读取资源后缀名</param>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T LoadAssetSyn<T>(string _assetBundleName, string _assetName, string _extension) where T : UnityEngine.Object;

        /// <summary>
        /// 读取资源（异步)
        /// </summary>
        /// <param name="_assetBundleName">AB包名称</param>
        /// <param name="_assetName">读取资源名称</param>
        /// <param name="_extension">读取资源后缀名</param>
        /// <param name="_callback">回调函数</param>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        void LoadAssetAsync<T>(string _assetBundleName, string _assetName, string _extension, Action<T> _callback) where T : UnityEngine.Object;

        /// <summary>
        /// 资源卸载（异步)
        /// </summary>
        /// <param name="_assetBundleName">AB包名称</param>
        void UnLoadAssetAsync(string _assetBundleName);
    }
}